
-------------------
Map notes: 
-------------------
Autonomous Robotic Systems 2022, DEEC, UC 


Four start-up maps are provided (with names: csquare, umap, fmap and stmap).
In all cases, the working area is 4x4 meters.
Several occupation grids are available: 

- "map"_grid1.png -> each image pixel represents 1x1 cm of working area (400x400x3 image).
- "map"_grid5.png -> each image pixel represents 5x5 cm of working area (80x80x3 image).
- "map"_grid10.png -> each image pixel represents 10x10 cm of working area (40x40x3 image).

Note: all navigation algorithms should be developed using the 5x5 grid. 

Each map also contains a .svg file (map image in vector format) and the corresponding 3D model to load in the Gazebo simulator. The folder "model_editor_models" contains all 3D models, which are also folders (with the name of each map). 
Copy these map folders for the "model_editor_models" folder in "/home/user" of the virtual machine.   

Tip: Windows users can use WinSCP (https://winscp.net/) to copy data between you computer and the virtual machine (use a sftp connection). MacOs users can use Cyberduck App. Linux users just need to write in the location path: sftp://user@192.168.1.xxx (replace with the IP of virtual machine).     


------------------------
Load a map in Gazebo: 
------------------------

Start up Gazebo+ROS in a empty world: user@ubuntu:~$ ./start-gazebo-empty.sh 

Stop the simulation (in the bottom-left "play" buttom).

Click in the "Insert Tab" in the left menu. Look for the "/home/user/model_editor_models" entry and select the desired map.  
Upon loading the model, manual placing (with the mouse) is required. Place it anywhere. 
In order to match the 3D model of the map with the 2D grid projections the following pose offsets are required:

- csquare: pose offset: x = 2; y = 2; z = 0 (meters)       
- umap: pose offset: x = 1.75m; y = 2m; z = 0 (meters) 
- fmap: pose offset: x = 2.1m; y = 2.1m; z = 0 (meters)
- stmap: pose offset: x = 2; y = 2; z = 0 (meters)

Go back to the "World" tab, in the left menu. Select the corresponding map model in the "Models" section, and edit the pose property (x,y,z) with the information above.  

Start the simulation.   


